#-------------------------------------------------
#
# Project created by QtCreator 2014-02-22T13:37:23
#
#-------------------------------------------------

QT       += core network multimedia

QT       -= gui

DEFINES += DEBUG MULTIMEDIA PULSE ALSA
LIBS += -lpulse-simple -lpulse -lasound

win32 {
    #for windows: enabling multimedia by default because it's the only input enabled by default in Qt
    DEFINES += MULTIMEDIA
    DEFINES -= PULSE ALSA
}

MULTIMEDIA {
    QT += multimedia
}
PHONON {
    LIBS += -lphonon
}
ALSA {
    LIBS += -lasound
}
PULSE {
    LIBS += -lpulse-simple -lpulse
}


TARGET = audio-transfer-server
CONFIG   += console c++11
CONFIG   -= app_bundle

TEMPLATE = app


SOURCES += main.cpp \
    audioserver.cpp \
    audiosink.cpp \
    user.cpp \
    readini.cpp \
    size.cpp \
    modules/pulse.cpp \
    modules/phonondevice.cpp \
    modules/tcpdevice.cpp \
    modules/nativeaudio.cpp \
    modules/alsadevice.cpp \
    audioformat.cpp \
    modules/udpdevice.cpp

HEADERS += \
    main.h \
    audioserver.h \
    audiosink.h \
    user.h \
    readini.h \
    size.h \
    modules/pulse.h \
    modules/phonondevice.h \
    modules/tcpdevice.h \
    modules/nativeaudio.h \
    modules/alsadevice.h \
    audioformat.h \
    modules/udpdevice.h

server.files = audio-transfer-server
server.path = ${DESTDIR}/usr/bin/
config.files = audio-transfer-server.ini
config.path = ${DESTDIR}/etc/
INSTALLS += server config

DEBUG {
    QMAKE_CFLAGS_DEBUG     += -fsanitize=address -fno-omit-frame-pointer
    QMAKE_CXXFLAGS_DEBUG   += -fsanitize=address -fno-omit-frame-pointer
    QMAKE_LFLAGS_DEBUG     += -fsanitize=address -fno-omit-frame-pointer
}
